1. Field of the Invention
The present invention relates to a recording apparatus for storing on a recording medium a data file of image data according to a predetermined file name naming rule in a digital camera or an audio recording apparatus, and a control method and program for such a recording apparatus.
2. Description of the Related Art
In recent years, due to developments of digital technology, a digital camera capable of electronically processing captured image information and video information has been in widespread use. In such a digital camera, an object image formed when an object light flux having passed through a shooting lens and reached a solid-state image sensor, such as a charge coupled device (CCD), is converted into electronic signals to be output as image signals. Various conversion processing operations are performed on the image signals output from the solid-state image sensor in an image processing circuit to ultimately store the image signals as an image file on a recording medium, such as a memory card.
As a standard for managing image files on a recording medium of a digital camera, Design rule for Camera File system (DCF) (Japanese Electronic Industry Development Association (JEIDA) standard:), which is a camera file system standard, is currently predominant. As a standard for managing video files on a recording medium, standards such as SD-Video and Advanced Video Codec High Definition (AVCHD) have widely been known.
In a digital camera, a file is generally managed using a file name with a number according to DCF standard. Specifically, directory names and file names in a recording medium are managed using numbers that do not overlap with one another, and the file names are generated by increasing the file number by one in the order of recording. In the DCF standard, the directory name includes xxxyyyyy (xxx: value from 100 to 999, y: arbitrary character), and the file name includes YYYYXXXX (XXXX: value form 0001 to 9999, Y: arbitrary character) Depending on a camera, there is a function that prevents the numbers from being overlapped irrespective of the recording medium in such a manner that previously recorded directory numbers and file numbers are stored in a built-in memory so that the directory numbers and file numbers are carried over even when the recording medium is replaced. When a switching function for disabling such function is simultaneously provided, it is also possible to record image data on a new recording medium by assigning an initial directory number and an initial file number (e.g., 100yyyyy directory, YYYY0001.JPG file).
However, in the above-mentioned file system standard, since there is a limitation in the naming rule for files and directories, a phenomenon of being prevented from generating a new file or a new directory occurs even though the actual recording memory is not full. Some digital cameras inhibit further recording when recording of a directory name “999yyyyy” and a file name “YYYY9999” has been performed. Therefore, when the directory number and the file number reach upper limits during image shooting, it is necessary to reset the numbers by initializing the recording medium once to continue the image shooting.
The image data is generally recorded on a recording medium which can be rewritten many times, such as a card type semiconductor memory and a digital versatile disc (DVD)-RW. On the other hand, it is expected that there will be more and more opportunities for recording image data on a DVD-R and recording mediums which allow data recording only for once will be increased.
In the case of recording a file on such a write-once recording medium, when the directory number and the file number reach the upper limits, it is no longer possible to perform image shooting by the digital camera that inhibits further recording as mentioned above. Furthermore, since the write-once recording medium cannot be reset by initialization, there is a possibility that it is impossible to shoot a new image by using the recording medium even though there is a free space.
There has been known a method wherein a recorded file structure is analyzed to detect an unused directory number and an unused file number, and recording is performed using the unused directory number and the unused file number. However, since images are reproduced in an ascending order of the directory number and the file number in the case of reproducing recorded images, there is a problem that the order of the images to be reproduced and the order of shooting are inconsistent, e.g., the temporal sequence is lost.
Japanese Patent Application Laid-Open No. 2003-150929 discusses a method of continuing recording on an unused directory or a newly generated directory when a file number reaches an upper limit. However, though the method discussed in Japanese Patent Application Laid-Open No. 2003-150929 has the advantage of being capable of continuing recording even when the file number reaches the upper limit, a temporal sequence of the file numbers and order of recording are lost. Since recording is performed with a folder and a file name having character strings that are different from those of the previously recorded folders and file names, file organization can be complicated after such recording.
In Japanese Patent Application Laid-Open No. 2003-158645, the number of files that can be generated on a recording medium is calculated based on a storage standard of a file, and the number of files that can be recorded on the recording medium is calculated based on a remaining capacity of the recording medium. After that, the file numbers are compared to each other to display the smaller value as the number of files that can be shot as well as to display a warning therefor together with a dealing method. Here, the dealing method is a method of renumbering directories in an ascending order from the initial value or a method of changing a directory name.